//
//  QuesTableViewCell.m
//  SuperNews
//
//  Created by dllo on 16/1/20.
//  Copyright © 2016年 qiang. All rights reserved.
//

#import "QuesTableViewCell.h"

@implementation QuesTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }
    return self;
}

- (void)createSubviews
{
    self.backgroundColor = [UIColor whiteColor];
    self.imageHeader = [[UIImageView alloc] init];
    self.imageHeader.layer.cornerRadius = 20;
    self.imageHeader.layer.masksToBounds = YES;
    self.imageHeader.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.imageHeader];
    
    self.userNameLabel = [[UILabel alloc] init];
    self.userNameLabel.font = [UIFont systemFontOfSize:17.0];
//    self.userNameLabel.backgroundColor = [UIColor brownColor];
    [self.contentView addSubview:self.userNameLabel];
    
    self.commentLabel = [[UILabel alloc] init];
    self.commentLabel.font = [UIFont systemFontOfSize:15.0];
    self.commentLabel.numberOfLines = 0;
//    self.commentLabel.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.commentLabel];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.imageHeader.frame = CGRectMake(10, 15, 40, 40);
    self.userNameLabel.frame = CGRectMake(60, 15, [UIScreen mainScreen].bounds.size.width - 60, 40);
    self.commentLabel.frame = CGRectMake(40, 55, [UIScreen mainScreen].bounds.size.width - 40, 40);
}

@end
